package cn.enilu.weblite.core.utils;

import cn.enilu.weblite.core.bean.constant.Const;
import cn.enilu.weblite.admin.bean.vo.node.MenuNode;

import java.util.ArrayList;
import java.util.List;

/**
 * api接口文档显示过滤
 *
 * @author fengshuonan
 * @date 2017-08-17 16:55
 */
public class ApiMenuFilter extends MenuNode {


    public static List<MenuNode> build(List<MenuNode> nodes) {

        List<MenuNode> menuNodesCopy = new ArrayList<>();
        for (MenuNode menuNode : nodes) {
            if (Const.API_MENU_NAME.equals(menuNode.getName())) {
                continue;
            } else {
                menuNodesCopy.add(menuNode);
            }
        }
        nodes = menuNodesCopy;

        return nodes;
    }
}
